package inttest;

/**
 * created by flyketch
 * 19-10-9 上午10:41
 */
public class CompareIntegerTest {

    public static void main(String[] args) {
        int i = 128;
        Integer i2 = 128;
        Integer i3 = new Integer(128);

        System.out.println("i == i2 " + (i == i2));
        System.out.println(i == i3);
        System.out.println(i2 == i3);

        Integer i4 = 128;
        System.out.println("i2 == i4 " + (i2 == i4));

        Integer i5 = 127;
        Integer i6 = 127;
        System.out.println("i5 == i6 " + (i5 == i6));


        Integer i01 = 128;
        int i02 = 128;
        Integer i03 = Integer.valueOf(128);
        Integer i04 = new Integer(128);

        System.out.println(i01 == i02);
        System.out.println(i01 == i03);
        System.out.println(i01 == i04);

        System.out.println(i02 == i03);
        System.out.println(i02 == i04);
    }
}
